import random
# 剪刀石头布小游戏
def game1():
    player_score = 0
    computer_score = 0
    for i in range(3):
        print("请出拳:1.石头 2.剪刀 3.布")
        player = int(input("请输入你的选择:"))
        computer = random.randint(1,3)
        print("电脑选择：%d" % computer)
        if player == computer:
            print("平局")
            player_score += 1
            computer_score += 1
        elif (player == 1 and computer == 3) or (player == 2 and computer == 1) or (player == 3 and computer == 2):
            print("本回合玩家获胜")
            player_score += 1
        else:
            print("本回合电脑获胜")
            computer_score += 1
    print("玩家分数：%d，电脑分数：%d" % (player_score, computer_score))
    if player_score > computer_score:
        print("恭喜你，你赢了")
    elif player_score < computer_score:
        print("你输了")
    else:
        print("平局")
game1()

def game2():
    computer = random.randint(1,100)
    count =0
    while True:
        player = int(input("请输入你的选择:"))
        count += 1
        if player == computer:
            print("恭喜你，猜对了")
            break
        elif player >computer:
            print("你猜的数字太大了")
        else:
            print("你猜的数字太小了")
        if count == 5:
            print("你猜的次数已经超过5次，游戏结束")
            print("电脑的数字是:",computer)
            break

game2()